package com.blb.common.fallback;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.common.entity.Product;
import com.blb.common.entity.ResponseResult;
import com.blb.common.feign.ProductServiceClient;
import org.springframework.stereotype.Component;

/**
 * 对商品服务调用的降级方法类
 */
@Component
public class ProductServiceFallback implements ProductServiceClient {

    @Override
    public Product getProductById(Long id) {
        return new Product(0L,"兜底数据",0.0,"A");
    }

    @Override
    public ResponseResult<Page<Product>> getProductPage(Long current, Long size) {
        return ResponseResult.ok(null);
    }

    @Override
    public ResponseResult<String> addProduct(Product product) {
        return ResponseResult.ok("faild");
    }

    @Override
    public ResponseResult<String> updateProduct(Product product) {
        return ResponseResult.ok("faild");
    }

    @Override
    public ResponseResult<String> removeProduct(Long id) {
        return ResponseResult.ok("faild");
    }
}
